package client;


import java.io.IOException;
import java.net.Socket;

import static constants.SocketConstants.*;

/**
 * @author srh
 * @date 2020/10/18
 **/
public class BIOClient {

    public static void main(String[] args) throws IOException {
        Socket socket = new Socket(LOCAL_HOST, PORT);

        socket.getOutputStream().write("bio".getBytes());
        socket.getOutputStream().flush();

        System.out.println("client send message: bio");

        byte[] buffer = new byte[BUFFER_BYTES];
        int readLength = socket.getInputStream().read(buffer);
        System.out.println(new String(buffer, 0, readLength));
        socket.close();

    }

}
